using System.Configuration;
using System.Data.SqlClient;

namespace Rioshu.Web.ViewStateHandlers
{
    public static class SqlConnectionManager
    {
        public static SqlConnection GetConnection()
        {
            var configuration = SqlPersisterConfigurationHandler.GetConfiguration();
            var connectionString =
                ConfigurationManager.ConnectionStrings[configuration.ConnectionStringName].ConnectionString;

            var connection = new SqlConnection(connectionString);

            return connection;
        }
    }
}